//
//  Student.m
//  文件管理
//
//  Created by liuchengming on 16/4/24.
//  Copyright © 2016年 liuchengming. All rights reserved.
//

#import "Student.h"

@implementation Student
@synthesize name,age;

-(void)encodeWithCoder:(NSCoder *)aCoder  //编码行为
{
    [aCoder encodeObject:name forKey:@"NAME"];
    [aCoder encodeInteger:age forKey:@"AGE"];
}
-(instancetype)initWithCoder:(NSCoder *)aDecoder    //解码行为
{
    self = [super init];
    self.name =[aDecoder decodeObjectForKey:@"NAME"];
    self.age = [aDecoder decodeIntForKey:@"AGE"];
    return self;
}

-(void)say
{
    NSLog(@"name=%@,age=%d",name,age);
}

@end
